
#include"server.hpp"
void text1()
{
    Json::Value stu;
    stu["名字"] = "小明";
    stu["年龄"] = 20;
    stu["成绩"] = Json::Value(Json::arrayValue);
    stu["成绩"].append(89);
    stu["成绩"].append(78);
    stu["成绩"].append(85);
    std::string ret;
    
    json_util::Serialize(stu,ret);

    std::cout<<ret<<std::endl;
}
void text2()
{
    std::string host="127.0.0.1";
    std::string user="root";
    std::string password="200411@Yjh";
    std::string db="gobang";
    std::string commed="insert stu values(null,'琦琦',18,58,68,98);";
    MYSQL* mysql=mysql_util::mysql_create(host,user,password,db);
    mysql_util::mysql_exc(mysql,commed);
    mysql_util::mysql_destory(mysql);
}
void text3()
{
    std::string src=",,,yuejianhua,,,gggggg,,,bbbbb,,,kkk";
    std::string sep=",,,";
    std::vector<std::string> res;
    int ret=string_util::split(src,sep,res);
    for(int i=0;i<res.size();i++)
    {
        std::cout<<res[i]<<std::endl;
    }
}
void text4()
{
    /* std::string host="127.0.0.1";
    std::string user="root";
    std::string password="200411@Yjh";
    std::string db="gobang";
    user_table user1(host,user,password,db);
    Json::Value examp;
    std::string res; 
    /* examp["username"]="xiaoming";
    examp["password"]="12345679";  */
    std::string host="127.0.0.1";
    std::string user="root";
    std::string password="200411@Yjh";
    std::string db="gobang";
    user_table user1(host,user,password,db);
    bool ret=user1.lose(1);
}
void text5()
{
    std::string host="127.0.0.1";
    std::string user="root";
    std::string password="200411@Yjh";
    std::string db="gobang";
    online_manager om1;
    user_table user1(host,user,password,db);

    room_mamager rm(&user1, &om1);
    match_manager mg(&om1,&rm,&user1);
}
void text6()
{   
    match_queue<int> match;
}
int main()
{
    std::string host="127.0.0.1";
    std::string user="root";
    std::string password="200411@Yjh";
    std::string db="gobang";
    gobang_server server(host,user,password,db);
    server.start(8085);
    return 0;
}